<?php


namespace app\index\controller;


use app\common\model\Reback;
use think\Controller;

class Doreback extends Controller
{
    public function index(){
        $jdz = new \app\common\model\Jdz();
        $reback = new Reback();
        $where['j.status'] =['in',[15,17,18,1,9,5,2,11,7]];
        $where['r.time'] =['<',time()-86400];
        $list = $jdz->alias('j')
            ->field('r.*,j.status as j_status')
            ->join('reback r','j.id=r.jdz_id AND j.status=r.status')
            ->where($where)
            //->distinct('r.jdz_id')
            ->order('r.time desc')
            ->select()->toArray();
        halt($list);
        foreach ($list as $v){

        }
    }

}